<?php abstract class generic extends RRDTemplate implements iRRDTemplate {
	protected static $CreateStr = '--step 60 DS:data:%type%:300:%min%:%max% RRA:AVERAGE:0.5:1:5000 RRA:AVERAGE:0.5:5:5000 RRA:AVERAGE:0.5:60:5000';
	public static function Feed ($Time, $Host, $Data) {
		list ($Type, $Name, $Min, $Max, $Data) = explode (',', $Data, 5);
		switch ($Type) {
			case 'g': $Type = 'GAUGE'; break;
			case 'c': $Type = 'COUNTER'; break;
			case 'd': $Type = 'DERIVE'; break;
			case 'a': $Type = 'ABSOLUTE'; break;
			default: Out::W (Msg::UnknownGeneric, $Type); return (FALSE);
		}
		$Filename = parent::Filename ($Host, '', $Name);
		parent::Create ($Filename, str_replace (array ('%type%', '%min%', '%max%'), array ($Type, $Min, $Max), self::$CreateStr));
		parent::Feed ($Filename, $Time, $Data);
		return (TRUE);
	}
} ?>